package routers

import (
	"gin-project-01/gin-step04/gin14-gorm-base/controllers/user"
	middlewares2 "gin-project-01/gin-step04/gin14-gorm-base/middlewares"
	"github.com/gin-gonic/gin"
)

func UserRouters(r *gin.Engine) {
	//路由分组中间件使用方式二
	routers := r.Group("/user")
	routers.Use(middlewares2.SaveAccessLog, middlewares2.UserMiddleWare01, middlewares2.UserMiddleWare02)
	{

		routers.GET("/list", user.UserController{}.List)

		routers.GET("/add", user.UserController{}.Add)

		routers.GET("/edit", user.UserController{}.Edit)

		routers.GET("/edit01", user.UserController{}.Edit01)

		routers.GET("/edit02", user.UserController{}.Edit02)

		routers.GET("/get", user.UserController{}.Detail)

		routers.GET("/del", user.UserController{}.Delete)

	}
}
